<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }

        li{
            list-style: none;
        }

        .bw{
            margin: 100px auto;
            background-color: #ffffff;
            width: 420px;
            padding-top: 3px;
        }

        .bw li{
            float: left;
            margin: 0 1px;
            cursor: pointer;
        }

        .bw img{
            width: 100px;
        }
        body{
            background: url(images/1.png) no-repeat  center top
        }

    </style>
</head>
<body>
    <ul class="bw">
        <li><img src="images/1.png" alt=""></li>
        <li><img src="images/2.png" alt=""></li>
        <li><img src="images/3.png" alt=""></li>
        <li><img src="images/4.png" alt=""></li>
        

        <script>
            const imgAll = document.querySelectorAll("img")
            for(const item of imgAll){
                item.onclick = function(){
                    document.body.style.backgroundImage = 'url('+this.src+')';
                }
            }
        </script>
</body>
</html>